CREATE TABLE [dbo].[ExceptionContent](
	[Handle] [bigint] IDENTITY(1,1) NOT NULL,
	[WriteUtc] [datetime] NOT NULL,
	[Content] [xml] NULL,
 CONSTRAINT [PK_ExceptionContent] PRIMARY KEY CLUSTERED 
(
	[Handle] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[ExceptionProperty](
	[Handle] [bigint] NOT NULL,
	[Name] [nvarchar](446) NOT NULL,
	[Value] [nvarchar](450) NULL,
 CONSTRAINT [PK_ExceptionProperty] PRIMARY KEY CLUSTERED 
(
	[Handle] ASC,
	[Name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ExceptionContent] ADD  CONSTRAINT [DF_ExceptionContent_WriteUtc]  DEFAULT (getutcdate()) FOR [WriteUtc]
GO
ALTER TABLE [dbo].[ExceptionProperty]  WITH CHECK ADD  CONSTRAINT [FK_ExceptionProperty_ExceptionContent] FOREIGN KEY([Handle])
REFERENCES [dbo].[ExceptionContent] ([Handle])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ExceptionProperty] CHECK CONSTRAINT [FK_ExceptionProperty_ExceptionContent]
GO
